package com.scroll;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ScrollView;
import android.widget.TextView;
import com.example.app.R;

public class TestScroll extends Activity {

	@SuppressLint("NewApi")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.scroll_view_test);
		final ScrollView sv=(ScrollView) findViewById(R.id.scrollId);
		final TextView tv=(TextView) findViewById(R.id.textView2);
		
		tv.postDelayed(new Runnable() {
			@Override
			public void run() {
				int x=Math.round(tv.getX());
				int y=Math.round(tv.getY());
				System.out.println("x:"+x+" y:"+y);
				sv.smoothScrollTo(x,y);
				//sv.scrollTo(x, y);
			}
		}, 500);
		
	}
}
